package com.dubbo.consumer.AccountController;

import com.alibaba.dubbo.config.annotation.Reference;
import com.dubbo.CarBalance.AccountCarerService;
import com.dubbo.common.dtos.ResponseResult;
import com.dubbo.model.balance.dtos.AccountCarerDto;
import com.dubbo.model.balance.dtos.AccountDetailDto;
import com.dubbo.model.balance.pojos.AccountCarer;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("carer")
public class AccountCarerController {

    @Reference(check = false)
    private AccountCarerService service;

    @GetMapping("findCarerList")
    public ResponseResult<List<AccountCarer>> findCarerList(@RequestBody AccountCarerDto dto){
       return service.list(dto);
    }

    @GetMapping("all")
    public ResponseResult<List<AccountCarer>> allList(){
        return service.allList();
    }

    @GetMapping("detail/{id}")
    public  ResponseResult<AccountDetailDto> detail(@PathVariable("id") String id){
        return service.detail(id);
    }
}
